package xby.study.proxy.cglib.noop;

import net.sf.cglib.core.DebuggingClassWriter;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.NoOp;
import xby.study.proxy.cglib.PathUtil;

public class NoOpTest {
    public void test() {
        System.out.println(this.getClass().getName() + "这个代理类啥也没干");
    }


    public static void main(String[] args) {
        System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, PathUtil.getOutPath(NoOpTest.class));
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(NoOpTest.class);
        enhancer.setCallback(NoOp.INSTANCE);
        NoOpTest test = (NoOpTest) enhancer.create();
        test.test();
    }
}
